#!/usr/bin/perl
use strict;
use warnings;

use Test::More;

plan tests => 17;

use_ok('Amazon::Bezos::Account');

my $acct = Amazon::Bezos::Account->new;

ok($acct);
ok(ref $acct eq 'Amazon::Bezos::Account');
ok($acct->access_key_id eq $ENV{'AWS_ACCESS_KEY_ID'});
ok($acct->secret_access_key eq $ENV{'AWS_ACCESS_KEY_SECRET'});

my $acct_test = Amazon::Bezos::Account->load('test','t/inc/bezos.yaml');
ok($acct_test);
ok(ref $acct_test eq 'Amazon::Bezos::Account');
ok($acct_test->name eq 'test');
ok($acct_test->access_key_id eq '1234567890');
ok($acct_test->secret_access_key eq 'sekret');
ok($acct_test->account_number eq '00000000');

my $acct_more = Amazon::Bezos::Account->load('one_more','t/inc/bezos.yaml');
ok($acct_more);
ok(ref $acct_more eq 'Amazon::Bezos::Account');
ok($acct_more->name eq 'one_more');
ok($acct_more->access_key_id eq '9999888877');
ok($acct_more->secret_access_key eq 'bar');
ok($acct_more->account_number eq '222222222');

# testing bezos.yaml in user directory, what is the right thing to do?
